package com.qf.service.impl;

import com.qf.dao.UsersDao;
import com.qf.dao.UsersDao2;
import com.qf.entity.Users;
import com.qf.service.UsersService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * 2019/10/9
 * Administrator
 * springboot1009
 * 面向对象面向君  不负代码不负卿
 */
@Service
public class UsersServiceImpl implements UsersService {

    @Override
    @Transactional
    public Users insert(Users users) {
        Users save = usersDao.save(users);
        System.out.println(5/0);
        return save;
    }

    @Resource
    private UsersDao usersDao;

    @Resource
    private UsersDao2 usersDao2;

    @Override
    public List<Users> getall() {
        //return usersDao.findAll();
        return usersDao2.getall();
    }
}
